export default{
    cartList(state){
        return state.cartList
    },
    // totalPrice(state){
    //     return state.
    // }
    totalPrice(state) {
        const cartList = state.cartList;
        return '￥' + cartList.filter(item => {
          return item.checked
        }).reduce((preValue, item) => {
          return preValue + item.count * item.price
        }, 0)
      },
      totalCount(state) {
        const cartList = state.cartList;
        return cartList.filter(item => {
          return item.checked
        }).reduce((preValue, item) => {
          return preValue + item.count 
        }, 0)
      },
}